<template>
  <div>
    <userimage class="userimage"></userimage>
    <usercard class="myproject"></usercard>
    <indexbody class="index-body"></indexbody>
  </div>
</template>

<script>
import userimage from "../../atom/userhome/userimage.vue"
import usercard from "../../atom/userhome/usercard.vue"
import indexbody from "@/components/molecule/userhome/indexbody.vue"

export default {
  name: "userindex",
  description: "用于用户信息主页的组件",
  mounted() {
    if(localStorage.getItem("token") === null){
      this.$notify.warning("登录信息过期请重新登录")
      this.$router.push("/")
    }
  },
  data() {
    return {
      image: "https://files.catbox.moe/9t2s5i.png",
      username: localStorage.getItem("username")
    }
  },
  components: {
    userimage, usercard, indexbody
  }
}
</script>

<style scoped lang="less">
@width: 59%;

.myproject {
  position: sticky;
  z-index: 999999999;
  top: 120px;
  left: 20px;
  margin: -50px;
}

.index-body {
  position: relative;
  top: -360px;
  left: 90%-@width;
  padding: 20px 20px;
}
</style>